package com.bootcamp.javase.polymorph;

/**
 * @program: PolyMorphCode
 * @description:
 * @author: Keyu Li
 * @create: 2021-09-02 21:29
 **/

public class TestAbstract{
    public static void main(String[] args) {
        C cc = new C();
        cc.showA();
        cc.showB();
        cc.showC();
    }
}

class C extends B {
    int c = 30;

    void showA() {
        System.out.println(a);
    }

    void showB() {
        System.out.println(b);
    }

    void showC(){
        System.out.println(c);
    }
}

abstract class A {
    int a = 10;

    abstract void showA();
}

abstract class B extends A {
    int b = 20;

    abstract void showB();
}